<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/libs/jquery-ui-1.10.3.custom/css/ui-lightness/jquery-ui-1.10.3.custom.css"></link>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/libs/jqgrid/css/ui.jqgrid.css"></link>

<script type="text/javascript"
	src="${pageContext.request.contextPath}/libs/jquery-1.9.0.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/libs/jqgrid/js/json2.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/libs/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/libs/jqgrid/js/jquery.jqGrid.src.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/libs/jqgrid/js/i18n/grid.locale-cn.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/libs/jqgrid/js/common.js"></script>

<title>资源管理</title>
</head>

<body>
	<table id="gridTable"></table>
	<div id="gridPager"></div>
</body>
</html>

<script type="text/javascript">
jQuery(document)  
.ready(  
        function() {  
            jQuery("#gridTable")  
                    .jqGrid(  
                            {  
                                url : '${pageContext.request.contextPath}/list/admin/resourceList/list.html',  
                                editurl : '${pageContext.request.contextPath}/operator/data/TResources/operator.html',  
                                datatype : "json",  
                                mtype : 'POST',  
                                height : 400,  
                                colNames : [ "资源ID","资源名称","资源描述","资源类型","优先级", "资源内容","状态" ],  
                                colModel : [ { 
name : 'resId', 
jsonmap : 'RES_ID', 
index : 'RES_ID', 
hidden: true, 
editable: false, 
search : false 
},{ 
name : 'resName', 
jsonmap : 'RES_NAME', 
index : 'RES_NAME', 
editable: true,
searchoptions : { sopt : [ "eq", "cn" ] },    search : true 
},{ 
name : 'resDesc', 
jsonmap : 'RES_DESC', 
index : 'RES_DESC', 
editable: true,
searchoptions : { sopt : [ "eq", "cn" ] },    search : true 
},{ 
name : 'resType', 
jsonmap : 'RES_TYPE', 
index : 'RES_TYPE', 
editable: true,
searchoptions : { sopt : [ "eq", "cn" ] },    search : true 
},{ 
name : 'resPriority', 
jsonmap : 'RES_PRIORITY', 
index : 'RES_PRIORITY', 
editable: true,
searchoptions : { sopt : [ "eq", "cn" ] },    search : true 
},{ 
name : 'resContent', 
jsonmap : 'RES_CONTENT', 
index : 'RES_CONTENT', 
editable: true,
searchoptions : { sopt : [ "eq", "cn" ] },    search : true 
},{ 
name : 'status', 
jsonmap : 'STATUS', 
index : 'STATUS', 
editable: true,
searchoptions : { sopt : [ "eq", "cn" ] },    search : true 
} ],  
                                sortname : 'RES_NAME',  
                                sortorder : 'asc',  
                                viewrecords : true,  
                                gridview : true,  
                                autowidth : true,  
                                rowNum : 20,  
                                rowList : [ 10, 20, 30 ],  
                                pager : jQuery('#gridPager'),  
                                jsonReader : {  
                                    page : "page.pageNo",  
                                    total : "page.totalPages",  
                                    records : "page.totalCount",  
                                    root : "page.result",  
                                    repeatitems : false,  
                                    id : 'RES_ID'  
                                },      
                                prmNames : {  
                                    rows : "page.pageSize",  
                                    page : "page.pageNo",  
                                    sort : "page.orderBy",  
                                    order : "page.order"  
                                },  
                                pager : "#gridPager",  
                                caption : "资源列表"  
                                }).navGrid('#gridPager', {  
                                    edit : true,  
                                    add : true,  
                                    del : true,  
                                    search : true  
                                }, {  
                                        //edit  
                                        beforeShowForm : function(form) {  
                                        },  
                                        reloadAfterSubmit : true,  
                                        closeAfterEdit : true, //修改完毕后关闭  
                                        afterComplete : opertaionPrompt  
                                    }, {  
                                        //add  
                                        beforeShowForm : function(form) {  
                                        },  
                                        reloadAfterSubmit : true,  
                                        closeAfterAdd : true, //新增完毕后关闭  
                                        afterComplete : opertaionPrompt  
                                    }, {  
                                        //del  
                                        reloadAfterSubmit : true,  
                                        afterComplete : opertaionPrompt  
                                    }, {  
                                        //组合查询  
                                        multipleSearch : true  
                                    });  
                                }); 
</script>